home *** CD-ROM | disk | FTP | other *** search
/ Champak 54 / Vol 54.iso / games / wiggi_wa.swf / scripts / DefineSprite_276 / frame_1 / DoAction.as
Encoding:
Text File  |  2007-09-27  |  977 b   |  41 lines

  1. function onEnterFrame()
  2. {
  3.    if(this.hitTest(_parent._parent._parent.STAGE))
  4.    {
  5.       touchBuffer++;
  6.       if(this.hitTest(_parent._parent.HERO.feet) and pressed == false and touchBuffer > 30)
  7.       {
  8.          pressed = true;
  9.          _parent._parent.HERO.drop = -15;
  10.          touchBuffer = 0;
  11.          _parent._parent._parent.STAGE.newSound("Sound_Switch");
  12.          if(switchStatus == false)
  13.          {
  14.             switchStatus = true;
  15.          }
  16.          else
  17.          {
  18.             switchStatus = false;
  19.          }
  20.       }
  21.       else if(this.hitTest(_parent._parent.HERO.feet) == false and touchBuffer > 30)
  22.       {
  23.          pressed = false;
  24.       }
  25.       if(switchStatus == true)
  26.       {
  27.          if(this._rotation < 180)
  28.          {
  29.             this._rotation += 20;
  30.          }
  31.       }
  32.       else if(this._rotation > 0)
  33.       {
  34.          this._rotation -= 20;
  35.       }
  36.    }
  37. }
  38. pressed = false;
  39. switchStatus = false;
  40. touchBuffer = 0;
  41.